package org.example.producer.service.impl;

import org.example.common.model.vo.TestVO;
import org.example.producer.service.TestService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

/**
 * @author lsliang
 */
@Service
public class TestServiceImpl implements TestService {

    private final RabbitTemplate rabbitTemplate;

    public TestServiceImpl(RabbitTemplate rabbitTemplate) {
        this.rabbitTemplate = rabbitTemplate;
    }

    @Override
    public void addTest(TestVO testVO) {
        rabbitTemplate.convertAndSend("test.direct", "key01", testVO);
    }
}
